package cn.edu.lingnan.servlet.club;

import cn.edu.lingnan.service.ClubService;
import cn.edu.lingnan.service.ClubServiceMysqlImpl;
import cn.edu.lingnan.service.StudentService;
import cn.edu.lingnan.service.StudentServiceMysqlImpl;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/admin/club/delClub")
public class DeleteClubServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String cid=req.getParameter("cid");
        System.out.println("[DEBUG 060]社团号为:"+cid);
        ClubService service=new ClubServiceMysqlImpl();
        service.deleteClubByCid(cid);
        resp.sendRedirect("/club/queryAllClub");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }
}
